gtk/gtkcontainer.c: Use accessor functions to access GtkWindow
authorJavier Jardón <jjardon@gnome.org>
Tue, 17 Aug 2010 13:07:51 +0000 (15:07 +0200)
committerJavier Jardón <jjardon@gnome.org>
Mon, 23 Aug 2010 18:18:03 +0000 (20:18 +0200)
gtk/gtkcontainer.c

index a1400d92f9fcff23e6c20580fb3f43fe9cca8e4a..d50b4194d0b2025c2d8018490fb9f525114355fd 100644 (file)
@@ -1956,15 +1956,16 @@ old_focus_coords (GtkContainer *container,
 {
   GtkWidget *widget = GTK_WIDGET (container);
   GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
+  GtkWidget *old_focus;
 
-  if (GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget)
+  if (GTK_IS_WINDOW (toplevel))
     {
-      GtkWidget *old_focus = GTK_WINDOW (toplevel)->focus_widget;
-      
-      return get_allocation_coords (container, old_focus, old_focus_rect);
+      old_focus = gtk_window_get_focus (GTK_WINDOW (toplevel));
+      if (old_focus)
+        return get_allocation_coords (container, old_focus, old_focus_rect);
     }
-  else
-    return FALSE;
+
+  return FALSE;
 }
 
 typedef struct _CompareInfo CompareInfo;